/**
 * author: zhangwei
 * 角色管理列表
 */
var main = {

    init: function() {
        this.initTable();
        this.tabBind();
    },
    initTable: function() {
        var _this=this;
        loadTable();
    },
    tabBind: function() {
        layui.use(['form'], function () {
            var form = layui.form;

            
        });
    }
}
main.init();

function loadTable() {
    layui.use('table', function(){
        var table = layui.table;
        var form = layui.form;
        var planName = $("#planName").val()
        var studentName = $("#studentName").val()
        table.render({
            elem: '#test'
            ,url:"/plan/queryStudentDetail?planName="+planName+"&studentName="+studentName
            ,title: '数据表'
            ,cols: [[
                {field:'planName', title:'计划名称'}
                // ,{field:'planDesc', title:'计划描述'}
                ,{field:'studentName', title:'学生名称'}
                ,{field:'score', title:'评分'}
                ,{field:'evaluate', title:'评价内容'}
                ,{field:'statusStr', title:'状态'}
                ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:200}
            ]]
            ,page: true
        });

        //监听行工具事件
        table.on('tool(test)', function(obj){
            var data = obj.data;
            if (obj.event === 'edit'){
                localStorage.planType = "edit";
                localStorage.id = data.id;
                parent.$t.goToPage(this, "/plan/detailStudent");
            }else if (obj.event === 'detail'){
                localStorage.planType = "detail";
                localStorage.id = data.id;
                parent.$t.goToPage(this, "/plan/detailStudent");
            }
        });
    });
}

